package com.woniuxy.oa.dao;

import com.woniuxy.oa.dao.provider.MeetProvider;
import com.woniuxy.oa.entity.Meet;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Result;
import org.apache.ibatis.annotations.Results;
import org.apache.ibatis.annotations.SelectProvider;

import java.util.List;

/**
 * @Auther: M
 * @Date: 2019/12/31 10:27
 * @Description:会议预定
 */
public interface MeetDAO {
    /**
     * @Description //新增会议室预定
     * @Date 2019/12/31 10:33
     * @param
     *@return void
     **/
    @Insert("inset into oa_meet (#{id},#{emp.id},#{subTime},#{startTime},#{endTime},#{room.id})")
    public void add();

    /**
     * @Description //根据条件查询所有部门
     * @Date 2019/12/31 10:45
     * @param
     *@return java.util.List<com.woniuxy.oa.entity.MeetRoom>
     **/
    @SelectProvider(type = MeetProvider.class,method = "getMeetByCondition")
    @Results({
            @Result(id = true,column = "id",property = "id"),
            @Result(column = "description",property = "room.description"),
            @Result(column = "STATUS",property = "room.STATUS"),
            @Result(id = true,column = "roodId",property = "room.id"),
            @Result(id = true,column = "employeeId",property = "emp.id"),
            @Result(column = "LEVEL",property = "emp.LEVEL"),
            @Result(column = "gender",property = "emp.gender"),
            @Result(column = "NAME",property = "emp.name"),
            @Result(column = "STATUS",property = "emp.status"),
            @Result(column = "phonenum",property = "emp.phoneNum"),
            @Result(column = "email",property = "emp.email")
    })
    public List<Meet> getAllMeetByCondition(Meet meet);
}